package com.dfs.parent.common.core.enums;

import lombok.Getter;

/**
 * @ClassName BaseController
 * @Author hong
 * @Date 2019/9/20 4:09 PM
 * @Version 1.0
 **/
@Getter
public enum ResultCode implements IErrorCode{

	SUCCESS(200,"成功"),
	FAIL(500,"失败"),
	JWT_TOKEN_EXPIRE(603,"token校验异常");

	private final Integer code;
	private final String msg;

	ResultCode(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}
	public static ResultCode getByCode(int code) {
		for (ResultCode item : ResultCode.values()) {
			if (item.getCode()==code ) {
				return item;
			}
		}
		return null;
	}
}
